<template>
	<view class="userLayout pageBg">
		<view class="statusBar" :style="{height: statusBarHeight() + 'px'}">
			
		</view>
		<view class="navBar" :style="{height: navBarHeight() + 'px'}">
			
		</view>
		<view class="userInfo">
			<view class="avatar" @click="showPopup">
				<image src="/static/images/xxmLogo.png" mode=""></image>
			</view>
			<view class="ip">
				192.168.1.18
			</view>
			<view class="address">
				来自于：北京
			</view>
		</view>
		<view class="section">
			<view class="list">
				<navigator class="row" url="/pages/classlist/classlist">
					<view class="left">
						<uni-icons type="download-filled" size="20" ></uni-icons>
						<text class="text">我的下载</text>
					</view>
					<view class="right">
						<text class="text">33</text>
						<uni-icons type="right" size="18" color="#aaa"></uni-icons>
					</view>
				</navigator>
				<navigator class="row" url="/pages/classlist/classlist">
					<view class="left">
						<uni-icons type="star-filled" size="20" ></uni-icons>
						<text class="text">我的评分</text>
					</view>
					<view class="right">
						<text class="text">0</text>
						<uni-icons type="right" size="18" color="#aaa"></uni-icons>
					</view>
				</navigator>
				<view class="row">
					<view class="left">
						<uni-icons type="chatboxes-filled" size="20" ></uni-icons>
						<text class="text">联系客服</text>
					</view>
					<view class="right">
						<uni-icons type="right" size="18" color="#aaa"></uni-icons>
					</view>
					<!-- #ifdef MP -->
						<button class="contact" open-type="contact">联系客服</button>
					<!-- #endif -->
					<!-- #ifdef WEB -->
						<button class="contact" @click="makePhoneCall">拨打电话</button>
					<!-- #endif -->
				</view>
			</view>
		</view>
		<view class="section">
			<view class="list">
				<view class="row">
					<view class="left">
						<uni-icons type="notification-filled" size="20" ></uni-icons>
						<text class="text">订阅更新</text>
					</view>
					<view class="right">
						<uni-icons type="right" size="18" color="#aaa"></uni-icons>
					</view>
				</view>
				<view class="row">
					<view class="left">
						<uni-icons type="flag-filled" size="20" ></uni-icons>
						<text class="text">常见问题</text>
					</view>
					<view class="right">
						<uni-icons type="right" size="18" color="#aaa"></uni-icons>
					</view>
				</view>
			</view>
		</view>
	</view>
	<uni-popup ref="alertDialog" type="dialog">
		<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="您需要确认授权，才能使用微信登录" @confirm="dialogConfirm"
			@close="dialogClose"></uni-popup-dialog>
	</uni-popup>
</template>

<script setup>
import { statusBarHeight, navBarHeight } from "@/utils/system.js"
import { ref } from 'vue'

const alertDialog = ref(null)
const makePhoneCall = () => {
	uni.makePhoneCall({
		phoneNumber: '15003100423'
	})
}
const showPopup = () => {
	// alertDialog.value.open()
	uni.showModal({
		title: "提示",
		content: "您需要确认授权，才能使用微信登录"
	})
}
const dialogClose = () => {
	
}
const dialogConfirm = () =>{
	
}
</script>

<style lang="scss" scoped>
.userLayout {
	.userInfo {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		padding: 50rpx 0;
		.avatar {
			width: 160rpx;
			height: 160rpx;
			border-radius: 50%;
			overflow: hidden;
			image {
				width: 100%;
				height: 100%;
			}
		}
		.ip {
			font-size: 40rpx;
			color: #333;
			padding: 20rpx 0 5rpx;
		}
		.address {
			font-size: 28rpx;
			color: #aaa;
		}
	}
	.section {
		border: 1px solid #f9f9f9;
		border-radius: 12rpx;
		width: 690rpx;
		margin: 30rpx auto;
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.08);
		.row {
			background-color: #fff;
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid #ddd;
			padding: 0 30rpx;
			position: relative;
			:deep() {
				.navigator-wrap {
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;
				}
			}
			&:last-child {
				border-bottom: none;
			}
			.left {
				display: flex;
				align-items: center;
				.text {
					color: #333;
					font-size: 30rpx;
					margin-left: 20rpx;
				}
				:deep() {
					.uni-icons {
						color: $brand-theme-color !important;
					}
				}
			}
			.right {
				display: flex;
				align-items: center;
				.text {
					color: #aaa;
					font-size: 30rpx;
					margin-right: 20rpx;
				}
			}
			.contact {
				position: absolute;
				top: 0;
				left: 0;
				height: 100%;
				width: 100%;
				opacity: 0;
			}
		}
	}
}
</style>
